package com.snu.liwei.lyl_api.controller;


import com.snu.liwei.lyl_api.entity.Video;
import com.snu.liwei.lyl_api.service.VideoService;
import com.snu.liwei.lyl_api.tools.UMsg;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

@RestController
@CrossOrigin(origins = {"http://192.168.31.215:3000","http://127.0.0.1:3000"})
@RequestMapping(value = "Video")
public class VideoController {

    @Autowired
    VideoService videoService;

    @RequestMapping("queryVideoByName")
    public UMsg getVideoByName(String videoName)
    {
        System.out.println("接口getVideoByName");
        List<Video> list = videoService.getVideoByName(videoName);
        return UMsg.ok(list);
    }

    @RequestMapping("queryVideoBySign")
    public UMsg getVideoBySign(String videoSign)
    {
        System.out.println("接口getVideoBySign");
        List<Video> list = videoService.getVideoBySign(videoSign);
        return UMsg.ok(list);
    }

    @RequestMapping("VideoList")
    public UMsg getAllVideo()
    {
        return UMsg.ok();
    }


}
